package com.yutel.test.date;

import java.text.SimpleDateFormat;
import java.util.Date;

public class DateUtil {
	private static SimpleDateFormat sdf = new SimpleDateFormat(
			"yyyy-MM-dd hh:mm:ss z");

	public static void main(String[] args) {
		long dd=1389315660323l;
		long2date(dd);
		long2date(1389318812349l);
	}

	public static void date2long(Date date) {
		String dd = sdf.format(date);
		System.out.println("" + date.getTime());
		System.out.println("" + dd);
	}

	public static void long2date(long time) {
		Date d = new Date(time);
		String dd = sdf.format(d);
		System.out.println("time=" + time);
		System.out.println("date=" + dd);
	}

}
